package com.vn.ld.order.service.management;

import java.util.ArrayList;
import java.util.Collections;

import com.vn.ld.btc.dao.entity.Order;

public class OrderList extends ArrayList<Order>{

	/**
	 * 
	 */
	private static final long serialVersionUID = -5430602050358880667L;

	@Override
	public boolean add(Order order){
		
		int index = Collections.binarySearch(this, order);
        if (index < 0) 
        	index = ~index;//= -1*(index) + 1
        
        super.add(index, order);
        return true;		
	}
}
